package com.sinosoft.comm.service;

import com.github.pagehelper.PageInfo;
import com.sinosoft.comm.condition.BaseCondition;
import com.sinosoft.utils.ID.UUIDUtil;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.List;

public interface BaseService<T,F extends BaseCondition>{
	@Transactional
	public T save(T entity);
	public T getById(Serializable id);
	@Transactional
	public int deleteById(Serializable id);
    public List<T> selectPage(F filter);
    public List<T> selectAll(F filter);
    public List<T> selectAll();
    public PageInfo<T> getPageList(F filter);
    @Transactional
    public int updateByFilter(T entity, F filter);
    @Transactional
    public int deleteByFilter(F filter);
    public int selectCountByFilter(F filter);
    /*@Transactional
    public int delAll(String did);*/
    @Transactional
    int delAll(List<String> idList);
    default String createPrimaryKey(){
        return UUIDUtil.getUUID();
    }
}
